<?php
// +----------------------------------------------------------------------
// | B5LaravelCMF
// +----------------------------------------------------------------------
// | Author: 李恒 <357145480@qq.com>
// +----------------------------------------------------------------------
namespace App\Validates;


class WebAdValidate extends ValidateBase
{
    public function rules()
    {
        return [
            'title' => 'required|min:2|max:50',
            'pos_id' => 'required'
        ];
    }

    public function attributes()
    {
        return [
            'title' => '信息标题',
            'pos_id' => '光广告位置'
        ];
    }

    /**
     * 跳转类型处理
     * @return ValidateBase
     */
    protected function before_validate()
    {
        $this->data['imglist']=$this->data['imglist']??[];
        if(is_array($this->data['imglist'])){
            $this->data['imglist']=implode(',',$this->data['imglist']);
        }
        return parent::before_validate(); // TODO: Change the autogenerated stub
    }
}
